/**  
* @Title: ExposeRevealController.java 
* @Description:   
* @author Lengxf  
* @date 2019年3月8日    
*/  
package com.penghaisoft.microwms.material.web.expose.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.penghaisoft.microwms.common.controller.BaseController;
import com.penghaisoft.microwms.common.dto.TransResult;
import com.penghaisoft.microwms.common.page.Pager;
import com.penghaisoft.microwms.common.wms.model.RawStorageSn;
import com.penghaisoft.microwms.material.web.intowarehouse.service.IMaterialIntoService;

/**  
* @Title: ExposeRevealController 
* @Description:   展示接口
* @author Lengxf  
* @date 2019年3月8日    
*/
@RestController
@RequestMapping(value = "/expose/reveal")
public class ExposeRevealController extends BaseController{
	
	@Autowired
	private IMaterialIntoService materialIntoService;

	/**  
	 * @Title: findQuantitiyWbMaterial
	 * @Description:   接口-查询黑白料库存
	 * @author Lengxf  
	 * @date 2019年3月8日    
	 */  
	@PostMapping("wbmaterial/quantitiy")
	public TransResult findQuantitiyWbMaterial(RawStorageSn rawStorageSn){
		
		RawStorageSn result = materialIntoService.findQuantitiyWbMaterial(rawStorageSn);
		return success(result);
	}
	
	/**  
	 * @Title: findQuantitiyMaterial
	 * @Description:   接口-原材料库存
	 * @author Lengxf  
	 * @date 2019年3月8日    
	 */  
	@PostMapping("material/quantitiy")
	public TransResult findQuantitiyMaterial(@RequestBody RawStorageSn rawStorageSn) {
		Pager<RawStorageSn> result = materialIntoService.findQuantitiyMaterial(rawStorageSn.getPage(),
				rawStorageSn.getRows(), rawStorageSn);
		return success(result);
	}
	
	/**  
	 * @Title: findQuantitiyMaterialToSn
	 * @Description:   接口-原材料库存查看单条明细
	 * @author Lengxf  
	 * @date 2019年3月11日    
	 */  
	@PostMapping("materialSn/quantitiy")
	public TransResult findQuantitiyMaterialToSn(@RequestBody RawStorageSn rawStorageSn) {
		Pager<RawStorageSn> result = materialIntoService.findQuantitiyMaterialToSn(rawStorageSn.getPage(),
				rawStorageSn.getRows(), rawStorageSn);
		return success(result);
	}
	
	/**  
	 * @Title: findQuantitiyMaterialInTime
	 * @Description:   手机APP接口-查询超期、未超期库存,不传参数
	 * @author Lengxf  
	 * @date 2019年3月18日    
	 */  
	@PostMapping("material/quantitiyInTime")
	public TransResult findQuantitiyMaterialInTime(RawStorageSn rawStorageSn) {
		List<RawStorageSn> result = materialIntoService.findQuantitiyMaterialInTime(rawStorageSn);
		return success(result);
	}
	
}
